<template>
<view class="page_l">
  <view class="top_bg">
		<image src="https://bigdataapi.parkic.com/static/images/7568678.png" mode="widthFix" style="width: 100%;"></image>
    <text class="text1 pos_a"></text>
    <text class="text2 pos_a"></text>
    <text class="text3 pos_a"></text>
    <text class="text4 pos_a"></text>
    <text class="text5 pos_a"></text>
    <text class="text6 pos_a"></text>
    <text class="text7 pos_a"></text>
    <text class="text8 pos_a"></text>
		<text class="name1">投资钟祥</text>
		<text class="name2">{{name}}</text>
    <view class="main_view">
      <!-- <image class="logo_image" src="~@/assets/logo.png" alt=""></image> -->
      <view class="login_view">
        <view class="input_view">
          <image src="~@/static/image/mobile.png" alt="" mode="widthFix"></image>
          <input type="text" v-model="loginData.mobile" placeholder="请输入账号">
        </view>
        <view class="input_view">
          <image src="~@/static/image/pwd.png" alt="" mode="widthFix"></image>
          <input type="password" v-model="loginData.password" placeholder="请输入密码">
        </view>
      </view>
      <view class="login_btn btn" @click="loginTo">登 录</view>
    </view>
  </view>
	<Tabbar current="3"></Tabbar>
</view>
</template>
<script> 
import Tabbar from '@/components/tabbar.vue'
import {login} from '@/utils/api.js'
import {hex_md5} from '@/utils/md5.js'
export default {
  data(){
    return{
      loginData:{
        mobile:'',
        password:'',
        login_type:1,
        id:uni.getStorageSync('role_id')
      },
      password:'',
			page:'',
			chain:'',
			name:''
    }
  },
	components:{
		Tabbar
	},
  onLoad(option){
		this.name = option.type
    uni.setStorageSync('xm_token','')
		this.page = option.page
		this.chain = option.chain
  },
  watch:{
    
  },
  beforeDestroy(){
   
  },
  methods:{
    loginTo(){
      let data = Object.assign({},this.loginData)
      data.password = hex_md5(this.loginData.password)
      login(data).then(res=>{
        if(res.status==1){
					uni.setStorageSync('xm_token',res.data.token )
          // localStorage.myCity_name = this.item.CityInfo.abbreviation
          // localStorage.myCity_type = this.item.CityInfo.type
          // localStorage.myCity_id = this.item.CityInfo.id
          // localStorage.mobile = this.loginData.mobile
          // localStorage.IndexId = this.loginData.id
          // localStorage.nickname=res.data.nickname 
          uni.showToast({
          	title:'登录成功',
          	icon:'none'
          })
          this.loginData.mobile=''
          this.loginData.password=''
          this.loginData.id=''
					if(this.page){
						uni.redirectTo({
							url:`/pages/${this.page}/${this.page}?chain=${this.chain}`
						})
						return
					}
          uni.switchTab({
          	url:'/pages/xxList/xxList'
          })
        }else{
          uni.showToast({
          	title:res.msg,
          	icon:'none'
          })
        }
      }).catch(err=>{
				uni.showToast({
					title:err,
					icon:'none'
				})
      })
    },
  }
}
</script>
<style lang="scss" scoped>
.phone{
  width: 100%;
  text-align: center;
  position: absolute;
  bottom: 30px;
  font-size: 16px;
  color: #fff;
  font-weight: 600;
}
.page_l{
  width: 100%;
  height: 100%;
}
.top_bg{
  width: 100%;
  height: 100%;
  position: relative;
  .text1{
    left: -4%;
    bottom: auto;
    background: hsla(0,0%,100%,.1);
  }
  .text2{
    right: 4%;
    top: 10%;
    background: hsla(0,0%,100%,.1);
  }
  .text3{
    top: 280px;
    right: 5.66666%;
    background: hsla(0,0%,100%,.3);
  }
  .text4{
    right: 7%;
    top: 320px;
    background: hsla(0,0%,100%,.15);
  }
  .text5{
      top: 38%;
      left: 1%;
      right: auto;
      background: hsla(0,0%,100%,.05);
  }
  .text6{
      width: 200px;
      height: 200px;
      top: 44%;
      left: 10%;
      right: auto;
      background: hsla(0,0%,100%,.15);
  }
  .text7{
      bottom: 50%;
      right: 36%;
      background: hsla(0,0%,100%,.04);
  }
  .text8{
			bottom: 70px;
      right: 2%;
      background: hsla(0,0%,100%,.2);
  }
}
.yy_view{
  position: absolute;
  display: flex;
  right: 20px;
  top: 20px;
  .yyimage{
    margin-left: 10px;
    width: 40px;
    cursor: pointer;
    padding: 5px;
  }
  .active{
    background: #5e72e4;
  }
}
.name1{
	position: absolute;
	top: 50px;
	left: 0;
	width: 100%;
	text-align: center;
	display: inline-block;
	color: #fff;
	font-size: 32px;
	font-weight: 888;
}
.name2{
	left: 0;
	position: absolute;
	top: 96px;
	width: 100%;
	text-align: center;
	display: inline-block;
	color: #fff;
}
.pos_a{
  position: absolute;
  height: 120px;
  width: 120px;
  border-radius: 50%;
}
.main_view{
  position: absolute;
  top: 45%;
  left: 50%;
  width: calc(100% - 50px);
  transform: translate(-50%,-50%);
  .logo_image{
    width: 80%;
    margin-left: 10%;
    margin-bottom: 30px;
  }
  .login_btn{
    margin-top: 0px;
		margin-left: 20px;
    width: calc(100% - 40px);
  }
}
.login_view{
  // box-shadow: 0 0px 30px 0px rgba(50, 50, 233, 0.5);
  padding: 40px 20px;
  // background-color: rgba($color: #fff, $alpha: 0);
  // border: .0625rem solid rgba(0,0,0,.05);
  border-radius: 16px;
  width: calc(100% - 40px);
  position: relative;
  .jzmm{
    position: absolute;
    right: 20px;
    bottom: 20px;
    color: #fff;
  }
  &::v-deep .ivu-input-group-append{
    padding: 0;
  }
  &::v-deep .ivu-select-selection{
    background: rgba($color: #000000, $alpha: .05);
    border: 1px solid rgba($color: #fff, $alpha: .5);
    color: #fff;
  }
  .input_view{
    position: relative;
    margin: 20px 0;
    input{
      height: 42px;
      border-radius: 6px;
      padding-left: 40px;
      width: 100%;
      // background: rgba($color: #000, $alpha: 0.05);
      border: 1px solid rgba(227, 227, 227, 1);            
      font-size: 15px;
      color: #333;
			width: calc(100% - 40px);
    }
    image{
      position: absolute;
      left: 14px;
      height: 16px;
      top: 12px;
			width: 16px;
    }
    input::-webkit-input-placeholder { /* WebKit browsers */ 
    color: #fff; 
    }
    input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ 
    color: #fff; 
    }
    input::-moz-placeholder { /* Mozilla Firefox 19+ */ 
    color: #fff; 
    }
    input:-ms-input-placeholder { /* Internet Explorer 10+ */ 
    color: #fff; 
    }
  }
}
.rb_view{
  position:absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #5e72e4;
  cursor: pointer;
}
.btn{
    height: 48px;
    line-height: 48px;
    border-radius: 20px;
    color: rgb(46, 187, 226);
    background-color: rgba(193, 251, 255, 0.8);
    border-color: #5e72e4;
    box-shadow: -2px 2px 3px rgb(255 255 255 / 60%) inset, 2px -2px 3px rgb(0 0 0 / 20%) inset;
    font-weight: 600;
    text-align: center;
    border: 1px solid transparent;
    position: relative;
    text-transform: uppercase;
    -webkit-transition: all .15s ease;
    transition: all .15s ease;
    will-change: transform;
    letter-spacing: .025em;
    font-size: 18px;
    cursor: pointer;
		
		border-radius: 8px;
		color: #fff;
		background: linear-gradient(90deg, rgba(110, 221, 255, 1) 0%, rgba(0, 145, 255, 1) 100%);
}
.logo{
  position: absolute;
  left: 20px;
  top: 20px;
  height: 60px;
  z-index: 60;
}
.v_image{
  height: 40px;
  cursor: pointer;
}
</style>